home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / netuser.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  1KB  |  53 lines

  1. /* Global structures and constants needed by an Internet user process */
  2. extern char *hosts;     /* Host table */
  3.  
  4. #define    NCONN    20        /* Maximum number of open network connections */
  5.  
  6. extern int32 ip_addr;    /* Our IP address */
  7.  
  8. extern int net_error;    /* Error return code */
  9. #define    NONE    0        /* No error */
  10. #define    CON_EXISTS    1    /* Connection already exists */
  11. #define    NO_CONN    2        /* Connection does not exist */
  12. #define    CON_CLOS    3    /* Connection closing */
  13. #define    NO_SPACE    4    /* No memory for TCB creation */
  14. #define    WOULDBLK    5    /* Would block */
  15. #define    NOPROTO        6    /* Protocol or mode not supported */
  16. #define    INVALID        7    /* Invalid arguments */
  17.  
  18. /* Codes for the tcp_open call */
  19. #define    TCP_PASSIVE    0
  20. #define    TCP_ACTIVE    1
  21. #define    TCP_SERVER    2    /* Passive, clone on opening */
  22.  
  23. /* Socket structure */
  24. struct socket {
  25.     int32 address;        /* IP address */
  26.     int16 port;            /* port number */
  27. };
  28.  
  29. /* Connection structure (two sockets) */
  30. struct connection {
  31.     struct socket local;
  32.     struct socket remote;
  33. };
  34. #define    NULLSOCK    (struct socket *)0
  35.  
  36. /* TCP port numbers */
  37. #define    ECHO_PORT    7    /* Echo data port */
  38. #define    DISCARD_PORT    9    /* Discard data port */
  39. #define    FTPD_PORT    20    /* FTP Data port */
  40. #define    FTP_PORT    21    /* FTP Control port */
  41. #define TELNET_PORT    23    /* Telnet port */
  42. #define SMTP_PORT    25    /* Mail port */
  43. #define FINGER_PORT     79      /* Finger port */
  44.  
  45. int32 aton(),resolve();
  46. char *inet_ntoa(),*psocket();
  47. long htol();
  48.  
  49. #ifdef    STDIO_H
  50. FILE    *myopen();
  51. #define    fopen    myopen
  52. #endif
  53.